<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>

<script type="text/javascript">
	$(document).ready(function() {
		
		$(loginform).submit(function() {
			
			if ($("input[name=id]").val() == "") {
				alert("아이디를 입력하세요");
				return false;
			}
			if ($("input[name=password]").val() == "") {
				alert("패스워드를 입력하세요");
				return false;
			}

		});//loginform submit

	});//ready
</script>

<c:choose>
	<c:when test="${sessionScope.mvo==null}">
		<div>
			<form name="loginform" method="post" action="login.do">
				아이디<input type="text" name="id"><br> 
				패스워드<input type="password" name="password"><br> 
				선생님<input type="radio" name="teacher">
				학생<input type="radio" name="teacher"><br> 
				<input type=submit value="로그인">
			</form>
			<form action="register.do" method="post" name="registerForm">
				<input type="submit" value="회원가입">
			</form>
		</div>
	</c:when>
<c:otherwise>
<form name="loginokForm" method="post" action="login.do">
<script type="text/javascript">
location.href="main.do";
</script>
</form>

</c:otherwise>
</c:choose>